<%-- 
    Document   : camera
    Created on : Mar 27, 2013, 5:52:05 PM
    Author     : Shaun McCready
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="org.domain.Item"%>
<%@page import="org.domain.Customer"%>
<%@page import="java.util.ArrayList"%>
<html>
  <head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org" />

  <title>Cameras - Products</title>
  <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
  <script type="text/javascript" src=
  "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
  <script type="text/javascript">
//<![CDATA[
  $(document).ready(function(){
        $('#nav li').hover(function () {
                $(this).find('.dropDown').slideToggle(200);
                $(this).toggleClass('active');
    });
  });
  //]]>
  </script>
</head>

<body>
  <div class="wrapper">
    	<div id="navContainer">
		<ul class="clear" id="nav">
			<li class="first"><a class="active" href="home.jsp">Home</a></li>
			<li><a  class="selected href="camera.jsp">Products</a>
				<div class="dropDown">
					<div class="top"></div>
					<div class="items">
						<ul>
							<li class="first"><a href="camera.jsp">Cameras</a></li>
							<li><a href="dvd.jsp">DVD Players</a></li>
							<li class="last"><a href="tv.jsp">Televisions</a></li>
						</ul>
					</div>
				</div>
			</li>
			<li><a href="order.jsp">Order</a></li>
			<li><a href="payment.jsp">Payment</a></li>
			<li class="last"><a href="logout">Logout</a></li>
		</ul>
	</div>
  </div>
<div class="shoppingcart" style="position:absolute; top:11px; right:25%; margin-right:0px;">
    <%
    String cart1 = request.getSession().getAttribute("cart").toString();
    int cart = Integer.parseInt(cart1);
    %>
    <img src="images/cart.png" width="30" height="30" />

    <span style="padding:0; color:silver;">Items: <%=cart%></span>

</div>
  <div id="mainContent">
    <h2>Video Cameras</h2>

        <%
            ArrayList<Item> inventory = (ArrayList<Item>)request.getSession().getAttribute("inventory");
          //  out.println("<tr>");
          //  for(int i = 0; i < inventory.size(); i++) {
           //     if(inventory.get(i).getProduct().equals("video camera")) {
            //        out.println("<td><h3>" + inventory.get(i).getProduct() + "</h3>" +
             //               "Brand: " + inventory.get(i).getManufacturer() + "<br />Price: $" + inventory.get(i).getPrice() +
              //              "</td>");
               // }

           // out.println("</tr>");
           // }
        %>

        <center>
            <table>
                <tr>
                    <td><img src="images/c1.jpg" alt="Camera 1" width="250" height="180" /></td>

                    <td><img src="images/c2.png" alt="Camera 2" width="250" height="180"/></td>

                    <td><img src="images/c3.jpg" alt="Camera 3" width="250" height="180"/></td>
                </tr>

                <tr>
                    <td>
                        <h3>Video Camera 1</h3>Brand: <%=inventory.get(1).getManufacturer()%> <br />
                        Price:$<%=inventory.get(1).getPrice() %> <br />
                        <form action="itemCart" method="POST">
                            <input type="hidden" name="itemname" value="1" />
                            <button type="submit">Add to Cart</button>
                        </form>

                    </td>

                    <td>
                        <h3>Video Camera 2</h3>Brand: <%=inventory.get(4).getManufacturer()%><br />
                        Price:$<%=inventory.get(4).getPrice() %> <br />
                        <form action="itemCart" method="POST">
                            <input type="hidden" name="itemname" value="4" />
                            <button type="submit">Add to Cart</button>
                        </form>
                    </td>

                    <td>
                        <h3>Video Camera 3</h3>Brand: <%=inventory.get(7).getManufacturer()%><br />
                        Price:$<%=inventory.get(7).getPrice() %><br />
                        <form action="itemCart" method="POST">
                            <input type="hidden" name="itemname" value="7" />
                            <button type="submit">Add to Cart</button>
                        </form>
                    </td>
                </tr>
            </table>
        </center>
  </div>

  <div id="footer">
    <center>
      <a href="home.jsp">Home</a> | <a href="camera.jsp">Products</a> | <a href="order.jsp">Order</a> | <a href=
      "payment.jsp">Payment</a> | <a href="logout">Logout</a><br />
      Copyright 2013 by Company X. All Rights Reserved.
    </center>
  </div>
</body>
</html>